import java.util.Stack;

class CQueue {
    //栈，先进后出
    public Stack<Integer> stack;
    public Stack<Integer> stack1;

    public CQueue() {
        stack = new Stack<>();//插入
        stack1 = new Stack<>();//删除

    }

    public void appendTail(int value) {//一个栈进行插入
        stack.push(value);
    }

    public int deleteHead() {//队头删除
        if (stack1.empty()) {
            if (!stack.empty()) {
                while (!stack.empty()) {
                    stack1.push(stack.pop());
                }
            } else {
                return -1;
            }
        }
        return stack1.pop();
    }
}
